package com.xoa.controller.guideGoal;

import com.xoa.service.sms.SmsService;
import com.xoa.util.CookiesUtil;
import com.xoa.util.common.StringUtils;
import com.xoa.util.common.session.SessionUtils;
import com.xoa.util.dataSource.ContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

/**
 * 创建作者:   高亚峰
 * 创建日期:   2017/7/27 14:15
 * 类介绍  :   督办页面转发
 * 构造参数:
 */
@RequestMapping("/guideGoal")
@Controller
public class GuideGoalViewController {

    @Resource
    SmsService smsService;
    //方针目标任务
    @RequestMapping("/MyGuideGoal")
    public String MySupervision(HttpServletRequest request) {
        //去掉事物提醒
        String bodyId=request.getParameter("bodyId");
        if(!StringUtils.checkNull(bodyId)){
            smsService.setRead(request,Integer.valueOf(bodyId));
        }
        Cookie redisSessionCookie = CookiesUtil.getCookieByName(request, "redisSessionId");
        String loginDateSouse = SessionUtils.getSessionInfo(request.getSession(), "loginDateSouse", String.class, redisSessionCookie);
        ContextHolder.setConsumerType("xoa" + loginDateSouse);
        return "/app/guidegoal/mySupervision/index";
    }
    //督办管理
//    方针目标管理
    @RequestMapping("/guideGoalManage")
    public String SupervisionManage(HttpServletRequest request) {
        Cookie redisSessionCookie = CookiesUtil.getCookieByName(request, "redisSessionId");
        String loginDateSouse = SessionUtils.getSessionInfo(request.getSession(), "loginDateSouse", String.class, redisSessionCookie);
        ContextHolder.setConsumerType("xoa" + loginDateSouse);
        return "/app/guidegoal/supervisionManage/index";
    }
    //督办分类
//    方针目标分类
    @RequestMapping("/guideGoalType")
    public String SupervisionType(HttpServletRequest request) {
        Cookie redisSessionCookie = CookiesUtil.getCookieByName(request, "redisSessionId");
        String loginDateSouse = SessionUtils.getSessionInfo(request.getSession(), "loginDateSouse", String.class, redisSessionCookie);
        ContextHolder.setConsumerType("xoa" + loginDateSouse);
        return "/app/guidegoal/supervisionType/index";
    }
    //督办统计
//    方针目标统计
    @RequestMapping("/guideGoalStatistic")
    public String Supervisionstatistic(HttpServletRequest request) {
        Cookie redisSessionCookie = CookiesUtil.getCookieByName(request, "redisSessionId");
        String loginDateSouse = SessionUtils.getSessionInfo(request.getSession(), "loginDateSouse", String.class, redisSessionCookie);
        ContextHolder.setConsumerType("xoa" + loginDateSouse);
        return "/app/guidegoal/statistic/index";
    }
    //督办办理
//    方针目标管理
    @RequestMapping("/guideGoalhandle")
    public String Supervisionhandle(HttpServletRequest request) {
        Cookie redisSessionCookie = CookiesUtil.getCookieByName(request, "redisSessionId");
        String loginDateSouse = SessionUtils.getSessionInfo(request.getSession(), "loginDateSouse", String.class, redisSessionCookie);
        ContextHolder.setConsumerType("xoa" + loginDateSouse);
        return "/app/guidegoal/supervisionManage/handle";
    }
}
